package com.yzw.phonestoreservice.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 商品规格表
 * @TableName phone_specs
 */
@TableName(value ="phone_specs")
@Data
public class PhoneSpecs implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer specsId;

    /**
     * 
     */
    private Integer phoneId;

    /**
     * 规格名称
     */
    private String specsName;

    /**
     * 库存
     */
    private Integer specsStock;

    /**
     * 单价
     */
    private BigDecimal specsPrice;

    /**
     * 小图
     */
    private String specsIcon;

    /**
     * 预览图
     */
    private String specsPreview;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PhoneSpecs other = (PhoneSpecs) that;
        return (this.getSpecsId() == null ? other.getSpecsId() == null : this.getSpecsId().equals(other.getSpecsId()))
            && (this.getPhoneId() == null ? other.getPhoneId() == null : this.getPhoneId().equals(other.getPhoneId()))
            && (this.getSpecsName() == null ? other.getSpecsName() == null : this.getSpecsName().equals(other.getSpecsName()))
            && (this.getSpecsStock() == null ? other.getSpecsStock() == null : this.getSpecsStock().equals(other.getSpecsStock()))
            && (this.getSpecsPrice() == null ? other.getSpecsPrice() == null : this.getSpecsPrice().equals(other.getSpecsPrice()))
            && (this.getSpecsIcon() == null ? other.getSpecsIcon() == null : this.getSpecsIcon().equals(other.getSpecsIcon()))
            && (this.getSpecsPreview() == null ? other.getSpecsPreview() == null : this.getSpecsPreview().equals(other.getSpecsPreview()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSpecsId() == null) ? 0 : getSpecsId().hashCode());
        result = prime * result + ((getPhoneId() == null) ? 0 : getPhoneId().hashCode());
        result = prime * result + ((getSpecsName() == null) ? 0 : getSpecsName().hashCode());
        result = prime * result + ((getSpecsStock() == null) ? 0 : getSpecsStock().hashCode());
        result = prime * result + ((getSpecsPrice() == null) ? 0 : getSpecsPrice().hashCode());
        result = prime * result + ((getSpecsIcon() == null) ? 0 : getSpecsIcon().hashCode());
        result = prime * result + ((getSpecsPreview() == null) ? 0 : getSpecsPreview().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", specsId=").append(specsId);
        sb.append(", phoneId=").append(phoneId);
        sb.append(", specsName=").append(specsName);
        sb.append(", specsStock=").append(specsStock);
        sb.append(", specsPrice=").append(specsPrice);
        sb.append(", specsIcon=").append(specsIcon);
        sb.append(", specsPreview=").append(specsPreview);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}